﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Invoicing.Resources
{
    public partial class ResourceManager : Pubs.PageHandle
    {


        private string _resourceName; //设置查询参数

        public string ResourceName
        {
            get { return _resourceName; }
            set { _resourceName = value; }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            //获取参数信息
            if (!IsPostBack)
            {
                //得到当前页的页码
                if (Request["pageNum"] != null)
                {
                    CurrentPageindex = int.Parse(Request["pageNum"].ToString());
                }
                DataBandManager();

            }
        }

        /// <summary>
        /// 数据绑定
        /// </summary>
        void DataBandManager()
        {

            string content = " 1=1 ";

            if (Request["pageNum"] != null)
            {
                CurrentPageindex = int.Parse(Request["pageNum"].ToString());
            }

            if (Request["searchName"] != null && Request["searchName"] != "")
            {
                content += " and po_name like'%" + Request["searchName"] + "%' ";
                ResourceName = Request["searchName"].ToString();
            }


            ZY.BLL.View_Tab_Power dall = new ZY.BLL.View_Tab_Power();
            TotalCount = dall.GetRecordCount(content);
            DataSet ds = dall.GetListByPage(content, "po_id desc  ", (CurrentPageindex - 1) * NumPerPage + 1, ((CurrentPageindex - 1) * NumPerPage) + NumPerPage);
            DeptList.DataSource = ds;
            DeptList.DataBind();


        }




    }
}